﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Kaskelot.SP.Model.Client;
using Kaskelot.SP.Model.Contracts;
using Kaskelot.SP.Services;
using Stockholm.SOA.Kaskelot.WCF.DataContracts;
using Kaskelot.SP.Services.Client.Mapping;

namespace Kaskelot.SP.UI.CONTROLTEMPLATES.Kaskelot.SP.UI.Forms
{
    public partial class KursForm : BaseForm, IForm
    {
        public string Id { get; set; }
        public string ParentId { get; set; }

        public Kurs Current { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(this.Id))
                {
                    KursService kursSvc = new KursService();

                    Guid kursId = new Guid(this.Id);
                    this.Current = kursSvc.GetKurs(kursId);
                }
                else
                {
                    this.Current = new Kurs();
                }
            }
            catch (Exception)
            {

            }
        }
    }
}
